{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 寻找合适的threshold"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 真实验证码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 211,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 85,  99, 107, 117, 124, 126, 135, 140, 144, 151, 158, 162, 168,\n",
       "       173, 180, 186, 197, 203, 208, 215, 221, 225, 232, 249], dtype=uint8)"
      ]
     },
     "execution_count": 211,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "im = Image.open('realcap/captcha (10).gif').convert('L')\n",
    "X_im = np.asarray(im).copy()\n",
    "uniques, counts = np.unique(X_im, return_counts=True)\n",
    "uniques"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 212,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAiYAAAFkCAYAAAAUtvC8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAIABJREFUeJzt3X2QXXWd5/H3FzBC4ZAwOklYZEbHJIDiw6QRWBhApyLJ\nhBmw1imYJoCrNe6iVU4mPkCJuytDLbNTAiIbYQcYlxKy9Fg668Q4kSZBxAcelG5lB3nIgw+gkIcx\nSTMBMUC++8c5LTeXTj/ee/vXyftVdcu+53z7nN/59ZH7ye/8zrmRmUiSJJXggMlugCRJ0iCDiSRJ\nKobBRJIkFcNgIkmSimEwkSRJxTCYSJKkYhhMJElSMQwmkiSpGAYTSZJUDIOJJEkqxriDSURcFBEP\nRsRA/bonIhY11VwWEb+IiGcj4q6IeGPT+mkRsTwitkbEzohYGRFHNtXMiIhbI2JH/bolIqY31RwV\nEavqbWyNiGsj4qDxHpskSZocExkxeQK4BJgPdAHfAL46GD4i4hJgKfAh4HhgE7AmIg5t2Ma1wNnA\nOcApwKuAr0VENNT0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QTcAfxRU01HznG/xE+S\nJBVjv5pjIkmSymYwkSRJxTCYSJKkYhhMJElSMQwmkiSpGAYTSZJUDIOJJEkqhsFEkiQVw2AiSZKK\nYTCRJEnFMJhIkqRi/H9bqEp+1HM+LwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f55d77d0550>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from pylab import *\n",
    "scatter(uniques, counts)\n",
    "show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 213,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "X_im[X_im <= 150] = 0\n",
    "X_im[X_im > 150] = 255"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 214,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAABYCAAAAAD+GP59AAAHlElEQVR4nO1dybbjKAxFfer/f1m9\niBmERgy2qW7uol5iYyG4aEAkKcB0sBP++VqBA4pDyGY4hGyGQ8hmOIRshkPIZjiEbIZDyGY4hGyG\nQ8hmOIRshkPIZjiEbIZDyGY4hGyGQ8hmOIRshkPIZvgLCIH3e3y/y4I/j0qH+RP7D+hIKUH66rMG\nC6ZMl53S9LggLRAy3GF6u9eK5yxkydJ+2T6AvvmCksdiyF/IBwsdX4SSZ2PIpEvME3JPyNgKv/rC\ntt8v8BQhX46pdN9TUpTKly+mgV5NfTNB/mPe7CnJS2KjJURf/81aUPgodyChkDf4iQQoSi3A84RM\n6G0IAVEusUs07v3uKoQHssP85PrZu+myICW0fHRxAhDhXHMZ9WrMA3ITkO4I4kMXSYPHXPLdeHnB\ndhsY7UNmxHId1ipunyNG0BM2sVEy19AM7lkIDgVtX+vhBRduj4zVSgy07wanlstdhLv7EFuV4TGS\nbOcW+ngjyCpzSBWb73slnt6HRNHZiDM90u0upOU3nWAkN9W+v/vWjEqIt8h9LyM+K2dH6ecFsT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     },
     "execution_count": 214,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Image.fromarray(X_im)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 模拟生成验证码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 274,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "r = util.RandomGenerateOneChar(y=1).convert('L')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 275,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAAAAACpleexAAADt0lEQVR4nG2UW4jVVRTGf3v/b2eO\nM+SMWaMWjpEkiqVgmWU3IxLFIqmQKFPEjKikm4YPUQ+9dLGeIiZ8CiEDDaMsohQjzAs1kVl2ER+U\njEZmbPDM+d/2/nqYM8eZo/v5t9e3FutbHxr7iqJ4CguWJT7z8rp9KmCNCWAcKF/4NVWsnTFYSpur\nEwHaAFpBSU73gKSTf68Fuqfc+wfxJUEVum22jr4HTJ87J5cOEGPDi8AyzyXtAmC35LPye6IAQlpe\nELD3jHscOpelXbmvhBai4RtmhYDzUaPf3AWHjySba7zo3B0rG19tEs/vnT0inTpJaeokbQF4S5LS\nzEly2g+v6VyIt/uPb6D0JLj1kfbB5p4nMwgSAAyztnG960ClPoyX75S0avliYNlnH0vDeV62DIlK\nfQ67ty5YBCzsOzQkrZ4vSb65hDx3I+CXpjptZPpbJW3sgRkzr1mrbHxFp76uyEAcnhwYGHI1/yCR\nBVjv07GFrXVz3inbzZ7sfE9nZ4cNzeSuwhsTBzKA96Z/8N3lgxk4HSCOTW/mmk2tSGzACtV9WUp9\ngOX1YZx+NzEx38k1es/UTmAWnkglHTuItcYG7MCd22pCEr4dBVUWqwMilurXT/a0EcVRhZ77D6GU\niDB45PQFaamTyL7QPx+SjgiYslcK0w1xicJx5sgH8f6nNX1d5VDGFuuW3HV+QmiqhcFkZ8omVng+\nWuX4BgbYNK3yBFC2g4q4LYzXZ80WC0nPAZXwsR3bJaVZWkhCx6HCB0obMw9ry513A1TYIfk8b+66\nfrTXPNufNUd5BQgAE1+x1xVjTOG0nzcai/XaNrUNbMNgHYfHukeuGM6912D9dLV9ArCzdiVmhAyr\n1e5aKue9Ro+r0E0jvu/p3qduDGCYBMC8/ySVzSt0uuVa5s15W/K6GmMCKvz8MtclITcf+6GuC+da\nKFslqSyKI5djgMhuKh+uE8XAM/vG3HXulOWlUl1FQLgUW+FTFQ8AUTQ+KXwmSVm+wNhq759RpRL+\n5pye3nhfGITJxZGS6kaYqu1UguDRf10mfcXE2F4EFtmbkyzT81PrgjDiR7l67a+VlwqpuhYTBYm0\n21aisF9eTgO7vpjZCmb+1a7I0Ff490mMnTsgLy/pZCuY6iEiTsjnQy+Z2PKPvOTLmmxLmIkOYKk3\n6pgsg00ATFD1LaDisma47KAFhQn4s6ORNl7ap4PraAvOykupnieChk9bpItk+7aKd+dHqhc0M23U\neqPC5tQvgbJF7QIwBvBfIwD+B4AHYkqY+QnhAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<PIL.Image.Image image mode=L size=40x40 at 0x7F55D7B5F050>"
      ]
     },
     "execution_count": 275,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 276,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "X = np.asarray(r).astype('float64')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 277,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "uniques, counts = np.unique(X, return_counts=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 278,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh4AAAFkCAYAAABvkjJwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAIABJREFUeJzt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\nY+SZlDJzC/AIRRuBSVYXEXEj8J+Bd5Td4i0HVLsYox72MJnbRGY+m5k/zMy/zcwPUfxD9ls03B72\ni8AjM4czc2ic145RFu+l6BFpNbbvAydGxCsreVo/TLehe3vRnLJ7cANwdi3pbLr4wz/7moh4KUVQ\n+lhm/oji4Di7kj4VmAfcOTEl7L693O8NlAPEKnmOBk5kEtcNQES8AngNu88Pk6YuIuKPgXdT/ETF\nI9W0A6ldjFUPo+SftG2ijQCmNN4eJnpUbYdH6J4C/DZFV9LrKG75+ScqI5Ypgq37KAZangz8EkV0\nu2yiy9/huriAIph6L0Wv0PXAU8BrJrpsXdznTwBnlp/924GvAT9t7TPwexSDyt5dHixfKtvHYRNd\n9p9zvw8r2/zJFCP2W8fAXu83xe8lPUzxm0lvAb5VnmhiovevU3VRpn2iPE+8FnhHecJ8eLLVRbkP\nT1LcTjq98jqkkmfSt4vx6uEAaxMfL+vhteXnfQ3FHZ7vbLo9THhldLhi30LRozEMbKe4ffTD1YOt\nzPdq4KvA08ATFF/KL5no8nehPj4A/JDix/fuBU6b6DJ1eX8HygPlZxT3rH8ZOL6W5/8CfkwxsGod\nMGeiy92B/Z5H8SX7XO31/+ztfgMvobhH/4nyuPgr4FUTvW+drAuKAXV3UPxn9zOKW+8/X9/PyVAX\no9TBc8CltXyTul2MVw8HWJv4XOX7YAvFP99nTUR78EfiJElSY/aLMR6SJGlyMPCQJEmNMfCQJEmN\nMfCQJEmNMfCQJEmNMfCQJEmNMfCQJEmNMfCQJEmNMfCQJEmNMfCQJEmNMfCQJEmN+f8BR3gCSM9R\nMi8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f55d7d60fd0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from pylab import *\n",
    "scatter(uniques, counts)\n",
    "show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 279,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "X[X <= 150] = 0\n",
    "X[X > 150] = 255"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 242,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAAAAACpleexAAAA20lEQVR4nK2USxaAIAwDUx73v3Jc\nKNCUVlnIRgtD+lUjYABoNBC3IYsGEOiPabAdontvwfbY3CcAo9dxRry9KBrnBgNDJAom2Dhn6Urd\nAV0CKzGwFylrilh1rKSmjoCxVn41h5meauTm+8sAxRbmvoLdDrmVTFWmEUlWnshMxb0xd/6y3zMO\nwlGUs5GhH7keT79i3YdoduKWzL4ZZqVqjmONAe290g703Nud9nL2F1j8V/53/TlmI5pckatU43nk\nWn+wYQgepxzOVXFrzQrAakhXi0GX4PH0nGHABSQsSEGRYpu+AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<PIL.Image.Image image mode=L size=40x40 at 0x7F55D7D36050>"
      ]
     },
     "execution_count": 242,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Image.fromarray(X)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 生成训练数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from PIL import Image, ImageFont, ImageDraw\n",
    "from zheye import util\n",
    "from random import randint\n",
    "import numpy as np\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "sample_size = 1000"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "X = []\n",
    "Y = []\n",
    "\n",
    "for i in range(sample_size):\n",
    "    #direction = np.random.binomial(1, 0.5)\n",
    "    #if direction == 0:\n",
    "    #    direction = -1\n",
    "    direction = -1\n",
    "    \n",
    "    ret = util.RandomGenerateOneChar(y=direction)\n",
    "\n",
    "    tmp = np.asarray(ret.convert('L')).astype('float64')\n",
    "    \n",
    "    tmp[tmp <= 150] = -1\n",
    "    # 黑色 \n",
    "    tmp[tmp >  150] = 1\n",
    "    # 白底\n",
    "    \n",
    "    X.append(tmp)\n",
    "    \n",
    "    if direction == 1:\n",
    "        Y.append([1,0])\n",
    "    else:\n",
    "        Y.append([0,1])\n",
    "\n",
    "X = np.array(X).astype(\"float64\")\n",
    "Y = np.array(Y).astype(\"uint8\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0 1]\n"
     ]
    }
   ],
   "source": [
    "print Y[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1000, 2)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Y.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 标准化是依照特征矩阵的列处理数据(to do)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 1.,  1.,  1., ..., -1.,  1.,  1.],\n",
       "       [-1.,  1.,  1., ...,  1.,  1.,  1.],\n",
       "       [-1., -1., -1., ...,  1.,  1.,  1.],\n",
       "       ..., \n",
       "       [ 1.,  1.,  1., ...,  1.,  1.,  1.],\n",
       "       [ 1.,  1.,  1., ...,  1.,  1.,  1.],\n",
       "       [ 1.,  1.,  1., ...,  1.,  1.,  1.]])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"\"\"\n",
    "mean = (X.sum(axis=0) /sample_size)\n",
    "Image.fromarray(mean)\n",
    "np.sum(mean)/mean.size\n",
    "X = (X.astype(\"float64\") - mean)/256\n",
    "\"\"\"\n",
    "\"\"\"\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1000, 40, 40, 1)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X = np.expand_dims(X, axis=3)\n",
    "X.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 存储"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 302,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "np.save('test_X', X)\n",
    "np.save('test_Y', Y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "np.save('train_X', X)\n",
    "np.save('train_Y', Y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 生成召回率/查准率样本\n",
    "\n",
    "$$\n",
    "\\begin{array}{c|lll}\n",
    "n & \\text{正样本} & \\text{负样本} \\\\\n",
    "\\hline\n",
    "\\text{识别为正样本} & \\text{True Positive} & \\text{False Positive(一类错误)} \\\\\n",
    "\\text{识别为负样本} & \\text{False Negative(二类错误)} & \\text{True Negative}\n",
    "\\end{array}|\n",
    "$$\n",
    "\n",
    "查准率$ Precision = TP/(TP+FP) $\n",
    "\n",
    "召回率$ Recall = TP/(TP+FN) $"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "np.save('testF_X', X)\n",
    "np.save('testF_Y', Y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "np.save('testT_X', X)\n",
    "np.save('testT_Y', Y)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
